<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="wt.httpgw.URLFactory"%>
<%
String baseUrl = new URLFactory().getBaseHREF();
%>

<head>
<title>创建新闻</title>
<style>


</style>
</head>
<body>


<center>
<div style="margin:10px 0;"></div>
	<div class="easyui-panel" title="企业新闻" style="width:720px" >
		<div style="padding:10px 0 10px 60px">
<form method="post" enctype="multipart/form-data" name="newsEntry" id="newsEntry">
<table  id="mytable"width="650"  >
  <tr>
    <td colspan="3" align="center">企业文化</td>
  </tr>
  <tr>
    <td width="182" >标题</td>
    <td colspan="2" ><input type="text" id="newsTitle" name="newsTitle" size="65"></input></td>
  </tr>
  <tr>
    <td >分发单位</td>
    <td colspan="2" ><input type="text" id="distributionUnit" name="distributionUnit" size="65"></input></td>
  </tr>
  <tr>
    <td >来源</td>
    <td colspan="2" ><input type="text" id="Source" name="Source" size="65"></input></td>
  </tr>
  <tr>
    <td >正文</td>
    <td colspan="2" ><textarea name="newsString" id="newsString" cols="65" rows="5"></textarea></td>
  </tr>
  <tr>
    <td >相关图片</td>
    <td colspan="2"> <input  type="file" id="inp_img" name="inp_img"  size="65" /></td>
  </tr>
  <tr>
    <td >附件</td>
    <td colspan="2" ><input  type="file" id="inp_newsSec" name="inp_newsSec"  size="65""/></td>
  </tr>
 <tr>
      <td>&nbsp;</td>
      <td align="center"><label>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitNews()">提交</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm1()">清除</a>
      </label></td>
    </tr>
</table>
</form>
</div>
</div>
</center>
<script type="text/javascript">

	function submitNews()
	{
		var title=document.getElementById("newsTitle").value;
		if(title==null||title=="")
		{
			 alert("标题不能为空");
			 return;
		}

		$('#newsEntry').submit();
	}
	

	function initCreateNews(){
		$("#newsEntry").form({
			url:'<%=baseUrl%>shmged/jsp/com/shlcm/documents/jspCreateNews.jsp',
			onSubmit:function (){
			},
			success:function (data){
				//alert(data);
				if(data.indexOf("ERROR") != -1){
					$.messager.alert('提示',"创建失败");
				}else{
					var oid=data.split("__");
					$.messager.alert('提示',oid[0]);
					$('#cmTabs').tabs('close','创建文档');
					addTab1("","",oid[1],oid[2]);
				}
				hideProcessMsg("prince_process_ques");
			},
			onLoadError:function (){
				hideProcessMsg("prince_process_ques");
			}
		});
	}

	initCreateNews();
</script>
</body>

</html>


